<!--suppress ALL -->
<include file="./Template/header.html" />

<link rel="stylesheet" type="text/css" href="/Template/css/scienceDetail.css">
<script type="text/javascript">


	$(function() {

		//初始化页面配置
//		initPage("科普详情");
        document.title = "{$info.title}";

		var app = new Vue({
			el: '#container',
			data: {
				info: [],
				list: []
			},
			methods: {
				doctorList: function(id) {
					window.location.href = "/wechat/doctor/index/categoryId/"+id;
				},
				activityList: function(id) {
					window.location.href = "/wechat/activity/index/categoryId/"+id;
				},
				productList: function (id) {
					window.location.href = "/wechat/product/index/categoryId/"+id;
				}
			}
		})

		$(".pop-frame").click(function() {
			$(".subscribe").hide();
		});

		setTimeout(function() {
			$('table').css({
				width: "100%"
			});

			$('.content p img').css({
				width: "100%",
				margin: "10px 0"
			});

			$('.content p span img').css({
				width: "100%",
				margin: "10px 0"
			});

			$('.content ul, .content ol').css({
				"padding-left":"1.2rem"
			});

			var fullWidth = $(".content").width();

			$("iframe").each(function() {
				var originSrc = $(this).attr("src").split("&",1)[0];
				var newSrc = originSrc + "&width=" + fullWidth + "&height=280&auto=0";
				$(this).css("width", fullWidth+"px");
				$(this).attr("src", newSrc);
				$(this).css("height", "280px");
			});

		}, 500);

	})

</script>

<div class="container" id="container">
	<div class="header">
		<p class="title">{$info.title}</p>
		<p class="head-info">
			<span class="doctor">{$info.doctor_name}</span>
			<span class="source">转自{$info.source}</span>
			<span class="time">{:date("Y-m-d", strtotime($info["create_time"]))}</span>
		</p>
	</div>
	<div class="image">
		<img class="bg-img" src="{$info.title_image}" alt="">
		<span class="count">阅读 {$info.read_count}</span>
	</div>
	<div class="content">
		{$info.content}
	</div>
	<div id="operation">
		<ul>
			<li class="recomend" v-on:click="doctorList({$info.category_id})">
				<img src="/Template/images/doctor-rec.png" alt="">
				<span>推荐医生</span>
			</li>
			<li class="activity" v-on:click="activityList({$info.category_id})">
				<img src="/Template/images/gift-bag.png" alt="">
				<span>线下活动</span>
			</li>
			<li class="product" v-on:click="productList({$info.category_id})">
				<img src="/Template/images/bottle.png" alt="">
				<span>相关产品</span>
			</li>
		</ul>
	</div>
	<if condition="$customer['subscribe'] neq 1">
		<div class="subscribe">
			<div class="pop-frame">
				<div class="hint">
					<div class="line"></div>
					<p class="rec-title">无法识别二维码?</p>
					<ul>
						<li>1、打开微信,点击添加朋友</li>
						<li>2、搜索微信号:xwkkffj</li>
						<li>3、点击”关注”,完成</li>
					</ul>
				</div>
			</div>
			<div class="two-d-code">
				<img class="two-d-code-bg" src="/Template/images/doc-2d-code-bg.png" alt="">
				<img class="two-d-code-img" src="/Template/images/xwk-qrcode.jpg" alt="">
				<p class="recognize">
					长按图片[识别二维码]关注公众号
				</p>
			</div>
		</div>
	</if>

</div>
<include file="./Template/footer.html" />